import request from '@/utils/request'

// 查询日常任务列表
export function listDailyTask(query) {
  return request({
    url: '/schedule/manager/dailyTask/list',
    method: 'get',
    params: query
  })
}

// 查询日常任务详细
export function getDailyTask(id) {
  return request({
    url: '/schedule/manager/dailyTask/' + id,
    method: 'get'
  })
}

// 新增日常任务
export function addDailyTask(data) {
  return request({
    url: '/schedule/manager/dailyTask',
    method: 'post',
    data: data
  })
}

// 修改日常任务
export function updateDailyTask(data) {
  return request({
    url: '/schedule/manager/dailyTask',
    method: 'put',
    data: data
  })
}

// 删除日常任务
export function delDailyTask(id) {
  return request({
    url: '/schedule/manager/dailyTask/' + id,
    method: 'delete'
  })
}

// 导出日常任务
export function exportDailyTask(query) {
  return request({
    url: '/schedule/manager/dailyTask/export',
    method: 'get',
    params: query
  })
}

// 获取全部事件类型
export function getDailyTaskAll() {
  return request({
    url: '/schedule/manager/dailyTaskEvent/getDailyTaskAll',
    method: 'get'
  })
}

// 获取人员
export function getPersonTree() {
  return request({
    url: 'person/personInfo/getPersonTree',
    method: 'get'
  })
}

// 日常任务开关
export function statusChanges(data) {
  return request({
    url: '/schedule/manager/dailyTask/statusChanges',
    method: 'post',
    data: data
  })
}